#pragma once

#include <iostream>
#include <memory>
#include "Socket.hpp"
#include "Log.hpp"

using namespace SocketModule;
using namespace LogModule;

//负责获取链接的模块
//链接管理器
class Listener
{
public:
    Listener(int port)
        :_port(port)
        ,_listensock(std::make_unique<TcpSocket>())
    {
        _listensock->BuildTcpSocketMethod(_port);
    }

    void Accepter()
    {
        LOG(LogLevel::DEBUG) << "hhahahhahahah Accepter";
    }

    int Sockfd() {return _listensock->Fd(); }
    ~Listener()
    {}
private:
    std::unique_ptr<Socket> _listensock;
    int _port;
};